import path from "path";
import {defineConfig} from 'vite';
import vue from "@vitejs/plugin-vue";

export default defineConfig(({command, mode}) => {
    return {
        resolve: {
            alias: {
                // 键必须以斜线开始和结束
                '/@/': path.resolve(__dirname, './src')
            }
        },
        plugins: [vue(),],
        server: {
            port: 80,
            proxy: {
                '/oauth2/': {
                    target: 'http://127.0.0.1:8080',
                    changeOrigin: true,
                    //rewrite: (path) => path.replace(/^\/api/, '')
                },
                '/jeesdp/': {
                    target: 'http://127.0.0.1:8081',
                    changeOrigin: true,
                    //rewrite: (path) => path.replace(/^\/api/, '')
                }
            }
        },
    }
})


